<include file="Common/Api/header_new" />
<div class="container-fluid">
<include file="Common/Api/left_menu_new" />
  
  <div class="affix container_right">
  
    <div class="title"><a href="apiadd-list.html">生成API</a>&nbsp;&gt;&nbsp;数据库</div>
    
    <a href="/Structure/importin.html" type="button" class="btn btn-primary sql-btn-margin">导入数据</a>
        
    <ul class="nav nav-tabs sql-list-margin" role="tablist">
       <li role="presentation" class="active _tab_li" data-key="db" data-type="1"><a href="#db_table_content" aria-controls="db_table_content" role="tab" data-toggle="tab">数据库</a></li>
       <li role="presentation" class="_tab_li" data-key="txt"  data-type="2"><a href="#txt_table_content" aria-controls="txt_table_content" role="tab" data-toggle="tab">文本</a></li>
    </ul>
    
    <div class="container container-sql-list tab-content">
        <div id="db_table_content" class="tab-pane active fade in" role="tabpanel"></div>
        <script id="db_list_template" type="text/html">
        <div>
           <table class="table table-bordered table-striped margin-top">
            <colgroup>
              <col class="col-xs-2">
              <col class="col-xs-2">
              <col class="col-xs-1">
              <col class="col-xs-2">
            </colgroup>
            <thead>
            <tr>
              <th>名称</th>
              <th>格式</th>
              <th>修改时间</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
                {{each list as value key}}
                <tr id="db_key_{{value.id}}">
                  <td class="text-left"><a>{{value.name}}</a></td>
                  <td>
                    {{if value.db_type=='mysql'}}
                    <span class="table-mysql">mysql</span>
                    {{else if value.db_type=='oracle'}}
                    <span class="table-orcale">orcale</span>
                    {{else}}
                    <span>无法识别</span>
                    {{/if}}
                  </td>
                  <td>{{value.update_time | dateFormat:'yyyy-MM-dd hh:mm:ss'}}</td>
                  <td class="table-text-btn">
                      <a href="/Structure/connectdb.html?id={{value.id}}" target="_blank">输入条件</a>
                      <a href="/Structure/dbfieldrule.html?id={{value.id}}" target="_blank">字段</a>
                      <a data-toggle="modal" data-target=".bs-example-modal-sm-close" class="_view_delete" data-id="{{value.id}}" data-name="{{value.name}}" data-type="1">删除</a>
                      <!-- <a class="_view_delete" data-id="{{value.id}}" data-name="{{value.name}}">删除</a> -->
                  </td>
                </tr>
                {{/each}}
            </tbody>
          </table>
          

          <!-- <nav class="text-right">
            <ul class="pagination">
              <li>
                <a href="#" aria-label="Previous">
                  <span aria-hidden="true">&lt;</span>
                </a>
              </li>
              <li class="active"><a href="#">1</a></li>
              <li><a href="#">2</a></li>
              <li><a href="#">3</a></li>
              <li><a href="#">4</a></li>
              <li><a href="#">5</a></li>
              <li>
                <a href="#" aria-label="Next">
                  <span aria-hidden="true">&gt;</span>
                </a>
              </li>
            </ul>
          </nav> -->
        </div>
        </script>

        <div id="txt_table_content" class="tab-pane fade" role="tabpanel"></div>
        <script id="txt_list_template" type="text/html">
        <div>
           <table class="table table-bordered table-striped margin-top">
            <colgroup>
              <col class="col-xs-2">
              <col class="col-xs-2">
              <col class="col-xs-1">
              <col class="col-xs-2">
            </colgroup>
            <thead>
            <tr>
              <th>名称</th>
              <th>格式</th>
              <th>修改时间</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
                {{each list as value key }}
                <tr id="file_key_{{value.id}}">
                  <td class="text-left"><a>{{value.name}}</a></td>
                  <td>
                    {{if value.file_type=='csv'}}
                    <span class="table-csv">csv</span>
                    {{else if value.file_type='json'}}
                    <span class="table-json">json</span>
                    {{else}}
                    <span>无法识别</span>
                    {{/if}}
                  </td>
                  <td>{{value.update_time | dateFormat:'yyyy-MM-dd hh:mm:ss'}}</td>
                  <td class="table-text-btn">
                      <a href="/Structure/editImportfile.html?id={{value.id}}" target="_blank">输入条件</a>
                      <a href="/Structure/filefieldrule.html?id={{value.id}}" target="_blank">字段</a>
                      <a data-toggle="modal" data-target=".bs-example-modal-sm-close" class="_view_delete" data-id="{{value.id}}" data-name="{{value.name}}" data-type="2">删除</a>
                      <!-- <a class="_view_delete" data-id="{{value.id}}" data-name="{{value.name}}">删除</a> -->
                  </td>
                </tr>
                {{/each}}
            </tbody>
          </table>

            <!-- <nav class="text-right">
              <ul class="pagination">
                <li>
                  <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&lt;</span>
                  </a>
                </li>
                <li class="active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li>
                  <a href="#" aria-label="Next">
                    <span aria-hidden="true">&gt;</span>
                  </a>
                </li>
              </ul>
            </nav> -->
        </div>
        </script>

    </div>
    
    
  </div>
</div>

<div class="modal fade bs-example-modal-sm-close" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">删除</h4>
      </div>
      <div class="modal-body text-center _delete_text">
        删除该数据库?
      </div>
      <input type="hidden" value="" class="_delete_id" />
      <input type="hidden" value="" class="_delete_type" />
      <div class="modal-footer">
        <button type="button" class="btn btn-info _delete_cancle" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary _delete_submit" data-dismiss="modal">确定</button>
      </div>
    </div>
  </div>
</div>


<script language="javascript" type="text/javascript" src="__PUBLIC__/home/dist/drag/tab.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/artTemplate.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/structureindex.js?v=1"></script>
</body>
</html>
